// Generated with RobotBuilder version 0.0.1
package org.usfirst.frc2876.Robot2013.subsystems;

import org.usfirst.frc2876.Robot2013.RobotMap;
import org.usfirst.frc2876.Robot2013.commands.*;
import edu.wpi.first.wpilibj.*;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;

/**
 *
 */
public class Shooter extends Subsystem {
    // The following variables are automatically assigned by
    // robotbuilder and will be updated the next time you export to
    // Java from robot builder. Do not put any code or make any change
    // in the following block or it will be lost on an update. To
    // prevent this subsystem from being automatically updated, delete
    // the following line.
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS

    Jaguar shootingJaguar = RobotMap.SHOOTER_SHOOTINGJAGUAR;
    Relay feederRelay = RobotMap.SHOOTER_FEEDER;

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
    //
    // TODO move the shooter to the lowest and highest points it can
    // physically be at and record the pot readings in these constants

    public Shooter() {
    }

    // Put methods for controlling this subsystem
    // here. Call these from Commands.
    public void initDefaultCommand() {
        // The following variables are automatically assigned by
        // robotbuilder and will be updated the next time you export to
        // Java from robot builder. Do not put any code or make any change
        // in the following block or it will be lost on an update. To
        // prevent this subsystem from being automatically updated, delete
        // the following line.
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND
        setDefaultCommand(new ShootIdle());
        // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND

        // Set the default command for a subsystem here.
        //setDefaultCommand(new MySpecialCommand());

    }

    public void startShooter() {
        shootingJaguar.set(1);
    }
    
    public void startFeeder(){
        feederRelay.set(Relay.Value.kForward);
    }
    public void endFeeder(){
        feederRelay.set(Relay.Value.kOff);
    }
    public boolean isFeederOn() {
        if (feederRelay.get() == Relay.Value.kForward) {
            return true;
        }
        return false;
    }
    public void endShooter() {
        shootingJaguar.set(0);
    }
}
